package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TExamPackage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TExamItemMapper;
import com.ruoyi.system.domain.TExamItem;
import com.ruoyi.system.service.ITExamItemService;

/**
 * 体检项目明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-27
 */
@Service
public class TExamItemServiceImpl implements ITExamItemService 
{
    @Autowired
    private TExamItemMapper tExamItemMapper;

    /**
     * 查询体检项目明细
     * 
     * @param id 体检项目明细主键
     * @return 体检项目明细
     */
    @Override
    public TExamItem selectTExamItemById(String id)
    {
        return tExamItemMapper.selectTExamItemById(id);
    }

    /**
     * 查询体检项目明细列表
     * 
     * @param tExamItem 体检项目明细
     * @return 体检项目明细
     */
    @Override
    public List<TExamItem> selectTExamItemList(TExamItem tExamItem)
    {
        return tExamItemMapper.selectTExamItemList(tExamItem);
    }

    /**
     * 新增体检项目明细
     * 
     * @param tExamItem 体检项目明细
     * @return 结果
     */
    @Override
    public int insertTExamItem(TExamItem tExamItem)
    {
        tExamItem.setCreateTime(DateUtils.getNowDate());
        return tExamItemMapper.insertTExamItem(tExamItem);
    }

    /**
     * 修改体检项目明细
     * 
     * @param tExamItem 体检项目明细
     * @return 结果
     */
    @Override
    public int updateTExamItem(TExamItem tExamItem)
    {
        tExamItem.setUpdateTime(DateUtils.getNowDate());
        return tExamItemMapper.updateTExamItem(tExamItem);
    }

    /**
     * 批量删除体检项目明细
     * 
     * @param ids 需要删除的体检项目明细主键
     * @return 结果
     */
    @Override
    public int deleteTExamItemByIds(String[] ids)
    {
        return tExamItemMapper.deleteTExamItemByIds(ids);
    }

    /**
     * 删除体检项目明细信息
     * 
     * @param id 体检项目明细主键
     * @return 结果
     */
    @Override
    public int deleteTExamItemById(String id)
    {
        return tExamItemMapper.deleteTExamItemById(id);
    }
    //根据项目名称找价格
    @Override
    public Double getPriceByName(String name) {
        return tExamItemMapper.getPriceByName(name);
    }
    @Override
    public List<TExamPackage> getPackageByName(String name) {
        return tExamItemMapper.getPackageByName(name);
    }
}
